#include "inet_address.h"

namespace rr {
namespace nio {

InetAddress::InetAddress(const std::string& ip, uint16_t port)
{
    Update(ip, port);
}

sockaddr *InetAddress::GetSockAddr()
{
    return (sockaddr *)&addr_;
}

void InetAddress::Update(const std::string& ip, uint16_t port)
{
    ip_ = ip;
    port_ = port;
    uv_ip4_addr(ip.c_str(), port, &addr_);
}

} //namespace 
} //namespace 
